package com.hotchpotch.adapter;

import android.support.annotation.Nullable;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hotchpotch.R;
import com.hotchpotch.bean.DBFlowTestBean;

import java.util.List;

/**
 * Created by Administrator on 2017/7/18 0018.
 */

public class RecyclerRefreshAdapter extends BaseQuickAdapter<DBFlowTestBean, BaseViewHolder>{
    private TextView tv1, tv2, tv3, tv4;

    public RecyclerRefreshAdapter(@Nullable List<DBFlowTestBean> data) {
        super(data);
    }

    public RecyclerRefreshAdapter(int layoutResId) {
        super(layoutResId);
    }

    public RecyclerRefreshAdapter(int layoutResId, @Nullable List<DBFlowTestBean> data) {
        super(layoutResId, data);
    }



    @Override
    protected void convert(BaseViewHolder helper, DBFlowTestBean item) {
        tv1 = helper.getView(R.id.item_dbflow_tv1);
        tv2 = helper.getView(R.id.item_dbflow_tv2);
        tv3 = helper.getView(R.id.item_dbflow_tv3);
//        tv4 = helper.getView(R.id.item_dbflow_tv4);
        helper.setText(R.id.item_dbflow_tv4, "年龄 = " + item.getAge())
                .addOnClickListener(R.id.item_dbflow_tv4);


        tv1.setText("id = " + item.getId());
        tv2.setText("姓名 = " + item.getName());
        tv3.setText("性别 = " + item.getSex());
//        tv4.setText("年龄 = " + item.getAge());
    }
}
